'Fishy

'ID
'Why 4157 ?
'duno
start
 4157 .out1 store
 *69 .out2 store
stop

'Seting fishy eyes / gender
cond
 *.robage 0 =
start
 500 .eye4width store
 500 .eye6width store
 255 .eye4dir store
 1256 255 sub .eye6dir store
 1 rnd 1 add 69 store 
 1 77 store
 *975 79 store
 0 975 store
stop

'mini oculous
start
*.eye6 *.eye4 sub sgn dup - ++ - add .focuseye store
stop

cond
 *.in1 4157 =
 *.out2 *.in2 =
 *.eyef 0 >
start
 314 628 rnd add .aimdx store
 30 *.velup *.veldx pyth sub .up store
stop

cond
 *.body *79 <
 *.robage 200 >
 *.nrg 2000 >
start
 100 .strbody store
stop

cond
 *.in1 4157 =
 *.refbody *.body %=
 *.Out2 *.in2 =
 *.eyef 0 >
start
 *.refaim .aim store
stop
 
'fishy mating
 
'male
'yay, a female !!
cond
 *.eyef 0 >
 *.in1 4157 =
 *.in2 2 =
 *69 1 =
 *.robage 200 >
 *.refage 200 >
start 
 *.refveldx .dx store
 *.refxpos *.refypos angle .setaim store
 'get as close as I can
 *.eyef 32000 <
 *.refvelup 10 add .up store
 dropbool
 'sprey sperm when im close enough
 *.eyef 50 >
 *.body .shootval store
 975 .shoot store
 dropbool
stop

'female
'Im Pregnant !!!!

cond
 *.nrg 2000 <
 *100 10 > or
start
 0 975 store
 0 100 store
 *.maxvel .up store
stop

cond
 *69 2 =
 *.robage 100 >
 *975 0 >
start
 *975 *.body add 2 div 975 store
 20 .repro store
 .100 inc
 *.maxvel .up store
stop

'eating fishy food
cond
 *.eyef 0 >
 *.refeye 0 =
start
 *.refveldx .dx store
 *.refvelup .up store
 *.refxpos *.refypos angle .setaim store
 'aproach food
 *.eyef 50 <
 *.refvelup 30 add .up store
 dropbool
 *.eyef 50 >
 -1 .shoot store
 dropbool
stop

'finding fishy food / swarming

cond
 *.eyef 0 =
start
'just to confuse Xp
 *55 55 >
 5 55 store
 20 rnd 66 store
 *77 - 77 store
 dropbool
 55 inc
 *66 *77 mult .aimdx store
 30 *.velup *.veldx pyth sub .up store
stop

'getting cought
cond
 *.eye5 0 >
 *.in1 8041 =
start
 *.refveldx .dx store
 *.refxpos *.refypos angle .setaim store
 0 .shoot store
 *.eyef 30 <
 *.refvelup 30 add .up store
 dropbool
 *.eyef 30 >
 1 .fixpos store
 dropbool
stop

end